#include <stdio.h>
#include <time.h>
//#include <conio.h>

#ifndef CLOCKS_PER_SEC
#define CLOCKS_PER_SEC 1000
#endif
/**
 * time 的单位为s
 */
void timer(long time)
{

    clock_t start;
    long    count = 1;
    start         = clock();
    while (1) {
        if ((clock() - start) != (time * CLOCKS_PER_SEC)) {
            //时间没有到，啥也不做，空循环
        } else {
            //时间到了退出循环
            // printf("%s","hello");
            break;
        }
    }
}
int main(void)
{

    for (int i = 0; i < 10; i++) {
        timer(10);
        printf("%d\n", i);
    }
    // getch();
}
